{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "dc22fe7a-d7cb-4d19-9c95-7cb9bde714d1",
   "metadata": {},
   "source": [
    "## 1. 赋值语句"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "fecf1e74-cc86-42ac-ad2c-cd95a9bab554",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "30"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "amount = 30\n",
    "amount"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a681d08c-9413-45fe-aec6-901c13ab76d5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "96755c09-ab0f-406a-9377-f1b901bf320b",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = 10\n",
    "b = 20"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "cc3d19af-896a-416e-8076-9021580e90be",
   "metadata": {},
   "outputs": [],
   "source": [
    "t = a\n",
    "a = b\n",
    "b = t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "336b07f7-8860-4bc7-b252-cc43b3cd0f51",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "db48a1d0-70d7-4249-9148-564479c17afc",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "af848fe0-4964-4af8-ae26-bc30c6261e86",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "2100797f-90d9-4eef-9344-c293c7a9a5e7",
   "metadata": {},
   "outputs": [],
   "source": [
    "a = 10; b = 20\n",
    "\n",
    "t = a; a = b; b = t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "84dea376-7948-47f9-8ee4-d1b8e755196c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "20"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3a0163b2-70e8-4134-bac1-8b630d5dad1b",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "8069e713-e902-4ef4-b8dd-3a34cd307fd2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "10"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e3f0353f-7720-4249-9115-dc051e778141",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "8dfc9b11-aa56-4b40-8466-cd5b0220202c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "37.5"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "价格 = 1.25; 数量 = 30\n",
    "\n",
    "价格 * 数量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5af44bcf-d52c-4875-b11d-b446c6aec25a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "f31d1537-074e-4835-95b0-29078c4bad6d",
   "metadata": {},
   "source": [
    "# 赋值语句"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "id": "d0c24a9b-c2af-421a-8bc7-bc4d32491df1",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "11"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "x = 10\n",
    "x += 1\n",
    "x"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5ffa0640-b5df-4225-ab77-49ab64e2d272",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "003c0a6f-ac31-47aa-b14f-3f954ad5183a",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
